#ifndef _LOCATION_H_
#define _LOCATION_H_

#include "posinfo.hpp"
#include "webclient.hpp"
#include <cstring>
#include <iostream>
#include <thread>

class Location {
private:
    bool upload_running = false;
    bool receive_running = false;
    std::thread upload_handle;
    std::thread receive_handle;
    WebClient webcli;
    std::string event_id;
    std::string index_code;
    int send_flag = 0;

public:
    Location();
    ~Location();
    void upload_thread();
    void receive_thread();
    void start();
    void stop();
    void set_send_flag();
    void msleep(int ms);
};

#endif
